package cn.sinata.wanglin.net.model.util;

import com.xilada.xldutils.activitys.BaseActivity;
import com.xilada.xldutils.fragment.BaseLazyFragment;

import rx.Subscriber;

/**
 *
 * Created by liaoxiang on 16/7/11.
 */
public class ResultSubscriber<T> extends Subscriber<T>{

    public ResultSubscriber(BaseActivity activity){

        if (activity!=null) {
            activity.compositeSubscription.add(this);
        }
    }

    public ResultSubscriber(BaseLazyFragment fragment){
        if (fragment!=null && !fragment.isDetached()) {
            fragment.addSubscriber(this);
        }
    }

    @Override
    public void onCompleted() {

    }

    @Override
    public void onError(Throwable e) {
        e.printStackTrace();
    }

    @Override
    public void onNext(T t) {

    }
}
